package com.gx.ObserverPattern.impl;


import com.gx.ObserverPattern.DisplayElement;
import com.gx.ObserverPattern.Observer;
import com.gx.ObserverPattern.Subject;

public class CurrentConditionsDisplay  implements Observer,DisplayElement {

	private float temperature;
	private float humidity;
	private Subject weatherData;
	
	public  CurrentConditionsDisplay(WeatherData weatherData) {
		this.weatherData = weatherData;
		weatherData.registerObserver(this);
	}	
	
	@Override
	public void update(float temp, float humidity, float pressure) {
		this.temperature=temp;
		this.humidity=humidity;
		display();

	}

	@Override
	public void display() {
		System.out.println("Current conditions:"+temperature+"F degress and " + humidity +"% humidity");
	}
	
	
	
	
}
